class GblogController < ApplicationController
  # GET /gblog
  # GET /gblog.xml
  def index
    @gblog= Gblog.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @gblog }
    end
  end

  # GET /gblog/1
  # GET /gblog/1.xml
  def show
    @gblog= Gblog.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @Gblog }
    end
  end

  # GET /gblog/new
  # GET /gblog/new.xml
  def new
    @Gblog = Gblog.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @Gblog }
    end
  end

  # GET /gblog/1/edit
  def edit
    @Gblog = Gblog.find(params[:id])
  end

  # POST /gblog
  # POST /gblog.xml
  def create
    @Gblog = Gblog.new(params[:Gblog])

    respond_to do |format|
      if @Gblog.save
        flash[:notice] = 'Gblog was successfully created.'
        format.html { redirect_to(@Gblog) }
        format.xml  { render :xml => @Gblog, :status => :created, :location => @Gblog }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @Gblog.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /gblog/1
  # PUT /gblog/1.xml
  def update
    @Gblog = Gblog.find(params[:id])

    respond_to do |format|
      if @Gblog.update_attributes(params[:Gblog])
        flash[:notice] = 'Gblog was successfully updated.'
        format.html { redirect_to(@Gblog) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @Gblog.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /gblog/1
  # DELETE /gblog/1.xml
  def destroy
    @Gblog = Gblog.find(params[:id])
    @Gblog.destroy

    respond_to do |format|
      format.html { redirect_to(gblog_url) }
      format.xml  { head :ok }
    end
  end

end
